﻿using DigitalScreen.Models;
using LiveCharts;
using LiveCharts.Wpf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Documents;
using System.Windows.Media;

namespace DigitalScreen.ViewModels
{
    internal class MainViewModel
    {
        public SeriesCollection StateSeries { get; set; }

        public List<CompareItemModel> WorkerCompareList { get; set; }

        private Random random = new Random();

        public MainViewModel()
        {
            #region 环状图数据初始化

            StateSeries = new SeriesCollection();
            StateSeries.Add(new PieSeries()
            {
                Title = "普货",
                Values = new ChartValues<double>(new double[] { 0.533 }),
                Fill = new SolidColorBrush(Color.FromArgb(255, 43, 182, 254))
            });
            StateSeries.Add(new PieSeries()
            {
                Title = "普货",
                Values = new ChartValues<double>(new double[] { 0.2 }),
                Fill = Brushes.Red
            });
            StateSeries.Add(new PieSeries()
            {
                Title = "普货",
                Values = new ChartValues<double>(new double[] { 0.167 }),
                Fill = new SolidColorBrush(Color.FromArgb(255, 144, 150, 191))
            });
            StateSeries.Add(new PieSeries()
            {
                Title = "普货",
                Values = new ChartValues<double>(new double[] { 0.1 }),
                Fill = Brushes.DimGray
            });

            #endregion 环状图数据初始化

            #region 人员绩效数据初始化

            string[] Empolys = new string[] { "赵XX", "钱XX", "孙XX" };

            WorkerCompareList = new List<CompareItemModel>();
            foreach (var e in Empolys)
            {
                WorkerCompareList.Add(new CompareItemModel()
                {
                    Name = e,
                    PlanValue = random.Next(100, 200),
                    FinishedValue = random.Next(10, 150)
                });
            }

            #endregion 人员绩效数据初始化
        }
    }
}